var db = require("./db")
var mongoose = require("mongoose")
var ObjectId = mongoose.Schema.Types.ObjectId;

var OrderSchema = new mongoose.Schema({
    goods:[{
            goodsId:{type:ObjectId,ref:"Goods"},
            count:Number
        }],
    shop:{type:ObjectId,ref:"Shop"},
    price:Number,
    user:{type:ObjectId,ref:"User"},
    addr:{type:ObjectId,ref:"ShopAddr"},
    begin:Number,
    end:Number,
    status:Number
})


module.exports = db.model('Order',OrderSchema)